# coding: utf-8
# Author: Legend奇
# @Time： 2020/11/27 上午10:16
from base.base_schema import BaseSchema


class SystemConfigSchema(BaseSchema):
    class Meta:
        fields = ('provider', 'province', 'initialized', 'domain')


class AreaSchema(BaseSchema):
    class Meta:
        fields = ('name', 'level', 'center')


class EngineRoomSchema(BaseSchema):
    class Meta:
        fields = ('name', 'full_position', 'area', 'default')


class DeviceSchema(BaseSchema):
    class Meta:
        fields = ('name', 'priority_ip_type', 'ipv4', 'ipv6', 'status', 'engine_room', 'device_type',
                  'device_number', 'process_ability', 'server_name', 'position', 'gateway')


class GatewaySchema(BaseSchema):
    class Meta:
        fields = ('name', 'ipv4', 'ipv6', 'netmask', 'engine_room', 'position')


class DeviceGroupSchema(BaseSchema):
    class Meta:
        fields = ('name', 'description', 'devices', 'default')


class AppSchema(BaseSchema):
    class Meta:
        fields = ('name', 'running_version', 'file_name', 'package_name', 'config_path', 'port', 'pid_file',
                  'install_path', 'log_path', 'deployment_type', 'must_config_data_guard', 'start_with_all_service',
                  'service_exception_handling', 'app_type', 'tags', 'daemon')


class AppVersionSchema(BaseSchema):
    class Meta:
        fields = ('version_number', 'release_note', 'app_type', 'create_timestamp', 'code_version')


class VersionPackageInfoSchema(BaseSchema):
    class Meta:
        fields = ('package_name', 'support', 'create_timestamp')


class ServiceSchema(BaseSchema):
    class Meta:
        fields = ('name', 'app', 'device', 'port', 'status', 'app_package_name')
